package com.ftx.controller.test.annotation.aop;

import com.ftx.controller.test.annotation.profile.MainConfigOfProfile;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by fengtingxin on 2020/4/24.
 */
public class IoCTest_AOP {

    @Test
    public void testImport(){


        //使用有参构造器
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigOfAop.class);
        System.out.println("容器创建完成");
        String [] beanNames = applicationContext.getBeanDefinitionNames();
        for (String name : beanNames){
            System.out.println(name);
        }

        BusinessClass businessClass =  applicationContext.getBean(BusinessClass.class);
        businessClass.div(1,1);

        System.out.println("第二个业务逻辑开始");
//        businessClass.div(1,0);

    }
}
